package gps.methods.uniform_cost;

import gps.Node;
import gps.methods.BaseMethod;
import gps.methods.BaseNode;
import gps_api.Rule;
import gps_api.State;

import java.util.Collections;

public class UniformCostMethod extends BaseMethod{
	
	@Override
	public void addChild(State state, Rule rule) {
		Node node= new BaseNode(lastNode, state, rule, rule.getCost(), 0.0);
		if(!isInClosedList(state)){
			openedNodes.add(node);
			Collections.sort(openedNodes);
		}
	}
}
